home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-04-14 | 3.8 KB | 76 lines | [TEXT/MPCC] |
- //=======================================================================================
- //
- // SHPrivate.h - private header for the Asynchronous Sound Helper
- //
- // Written by Bryan K. Ressler (Beaker), 2/4/92
- // Updated by Bradley D. Mohr, 2/4/95
- //
- // Version 1.00, 2/4/92 Original version
- // 1.01, 2/20/92 Added SHGetState to fix handle semaphore problem
- // 1.02, 3/21/92 Make handle/error checks more explicit, modify
- // SHPlayStopByRec (to handle channels with no synthesizer)
- // 1.03, 4/4/92 Modifications per KO, RC, JR. Public routines now pascal.
- // 1.04, 4/20/92 Reverted to SHPlayPause/SHPlayContinue structure.
- // 1.04a 2/4/95 Updated to worth with Universal Headers & SM 3.0 (BDM)
- //
- //=======================================================================================
-
- //=======================================================================================
- // Includes
- //=======================================================================================
- #include "Std.h"
-
- //=======================================================================================
- // Contants used by the Asynchronous Sound Helper
- //=======================================================================================
- #define kSHDefChannels 4 // Default number of channels to preallocate
- #define kSHCompleteSig 'SH' // Flag we use to know a "true" completion callback
- #define kSHComplete 'SHcp' // Flag that a given channel has completed playback
- #define kSHHeaderSlop 100 // Extra bytes for the sound header when recording
- #define kSHBaseNote 60 // Middle C base note for new recordings
- #define kSHSyncWaitTimeout 60 // Ticks to sync-wait when killing the Helper
-
- //=======================================================================================
- // Constants that should be in Sound.h but aren't
- //=======================================================================================
- #define kSHNoSynth 0 // Don't associate any synth to this channel
- #define kSHNoInit 0 // No specific initialization
- #define kSHQuietNow true // Stop playing this sound immediately
- #define kSHAsync true // Play asynchronously
- #define kSHWait false // Wait for there to be enough room in the queue
-
- //=======================================================================================
- // Structures
- //=======================================================================================
- typedef struct {
- SndChannel channel; // Our sound channel
- long refNum; // Our Helper ref num
- Handle sound; // The sound we're playing
- Fixed rate; // The rate at which a sampled sound is playing
- char handleState; // The handle state to restore this handle to
- Boolean inUse; // Tells whether this SHOutRec is in use
- Boolean paused; // Tells whether this sound is currently paused
- } SHOutRec, *SHOutPtr;
-
- typedef struct {
- short numOutRecs; // The number of output records in outArray
- SHOutRec *outArray; // Our pre-allocated output records
- long nextRef; // The next available output reference number
- } SHOutputVars;
-
- typedef struct {
- long inRefNum; // Sound Input Manager's device refNum
- SPB inPB; // The input parameter block
- Handle inHandle; // The handle we're recording into
- short headerLength; // The length of the sound's header
- Boolean recording; // Tells whether we're actually recording
- Boolean recordComplete; // Tells whether recording is complete
- OSErr recordErr; // Error, if error terminated recording
- short numChannels; // Number of channels for recording
- short sampleSize; // Sample size for recording
- Fixed sampleRate; // Sample rate for recording
- OSType compType; // Compression type for recording
- Boolean *appComplete; // Flag to caller that recording is done
- Boolean paused; // Tells whether recording has been paused
- } SHInputVars;
-